#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
int data[10]={6,2,5,5,4,5,6,3,7,6};
int cal(int x){
    int rev=0;
    while(x){
        rev+=data[x%10];
        x/=10;
    }
    return rev;
}
int main(int argc, char **argv){
    int a,b;
    scanf("%d%d",&a,&b);
    int sum = 0;
    for(int i=a; i<=b;i++){
        sum+=cal(i);
    }
    printf("%d\n",sum);
    return 0;
}
